package com.example.demospring3_2.controller;

import com.example.demospring3_2.service.DemoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.service.annotation.GetExchange;

import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;

@Slf4j
@RestController
@RequestMapping("demo")
public class DemoController {
    @Autowired
    DemoService demoService;
    @GetMapping("/")
    public String index(String param) {
        AtomicInteger i = new AtomicInteger();
        String result = demoService.getBaidu(param);
        log.info("请求结果：{}", result);
        return "return: "+param +"<br/>" + result;
    }
}
